<template>
    <div class="section-wrap">
        <div class="form-section">
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>隐患类别</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div class="right-select"
                     @click="selectType">
                     <p>
                    {{hiddenmeta.category?hiddenmeta.category:"请选择"}}
                    </p>
                    <i class="iconfont icon-jinru rightmsg"></i>
                </div>
            </div>
            <div class="form-item form-item-style2">
                <div class="label-title space-between">
                    <div class="space-between">
                        <label>隐患描述</label>
                        <i class="iconfont icon-required"></i>
                    </div>
                    <a @click="toselectmsg">选择隐患</a>
                </div>
                <div>
                    <textarea @change="hidenewfirst(hiddenmeta.description)"
                              placeholder="请输入隐患描述（自行换行）"
                              v-model="hiddenmeta.description"></textarea>
                </div>
            </div>
            <!--<div class="form-item form-item-style2">
                <div class="label-title space-between">
                    <label>整改前照片</label>
                    <span>当前共0张照片</span>
                </div>
                <div class="upload-wrap">
                    <uploader
                    :max="5"
                    :show-header="false"
                    :autoUpload="false"
                    @add-image="addimage"
                    :handleClick="false"
                    @preview="previewmsg"
                    @upload-image="showimage"
                              size="small"></uploader>
                </div>
            </div>-->
            <div class="form-item form-item-style2">
                <div class="label-title space-between">
                    <div class="space-between">
                        <label>整改前照片</label>
                        <!--<i class="iconfont icon-required"></i>-->
                    </div>
                    <span>当前共{{hiddenmeta.uploadImgs.length}}张照片</span>
                </div>
                <div class="upload-wrap">
                    <upload @setFormData="setFormData"
                            :uploadImgss="hiddenmeta.uploadImgs"
                            :images="hiddenmeta.images"
                            :newBlobList="hiddenmeta.newBlobList"
                            ></upload>

                           <!-- :uploadImgFormData="hiddenmeta.formdata"-->

                </div>
            </div>
            <div class="form-item form-item-style2">
                <div class="label-title">
                    <label>整改措施</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div>
                    <textarea placeholder="请输入隐患措施（自行换行）" @change="hidenewtwo(hiddenmeta.measure)"
                              v-model="hiddenmeta.measure"></textarea>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>隐患级别</label>
                </div>
                <group>
                    <popup-picker :data="list1"
                                  v-model="hiddenmeta.hdLevel"
                                  @on-change="changeleve"
                                  placeholder="请选择"></popup-picker>
                </group>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>整改开始时间</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <group>
                    <datetime
                    :start-date = "showDate"
                    v-model="hiddenmeta.resolveStartTime"
                              @on-change="newchange"></datetime>
                </group>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>整改结束时间</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <group>
                    <datetime
                    :start-date = "showDateEnd"
                    v-model="hiddenmeta.resolveEndTime"
                              @on-change="newchangeend"></datetime>
                </group>
            </div>

            <!--*************子公司************-->
            <div v-if="showmsg==1">
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>所属单位</label>
                    </div>
                    <div class="newcompanyList"
                         style="width: 200px;height: 54px;overflow: hidden;">
                        {{hiddenmeta.deptName}}
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>被检查单位负责人</label>
                    </div>
                    <div class="newcompanyList">
                        {{hiddenmeta.projectDutyPerson}}
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>隐患部位</label>
                    </div>
                    <div class="right-select">
                        {{hiddenmeta.resolveArea?hiddenmeta.resolveArea:"无"}}
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>整改责任人</label>
                        <i class="iconfont icon-required"></i>
                    </div>
                    <div class="right-select">
                        {{hiddenmeta.resolveAreaDutyPerson?hiddenmeta.resolveAreaDutyPerson:"请选择"}}
                        <i @click="newperson"
                           v-if="hiddenmeta.resolveArea=='无'"
                           class="iconfont icon-jinru rightmsg"></i>
                    </div>
                </div>
            </div>

            <!--*************公司对项目************-->
            <div v-if="showmsg==2">
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>所属单位</label>
                    </div>
                    <div class="newcompanyList"
                         style="width: 200px;height: 54px;overflow: hidden;">
                        {{hiddenmeta.deptName}}
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>被检查单位负责人</label>
                    </div>
                    <div class="newcompanyList">
                        {{hiddenmeta.projectDutyPerson}}
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>隐患部位</label>
                    </div>
                    <div class="right-select"
                         @click="newposition">
                        {{hiddenmeta.resolveArea?hiddenmeta.resolveArea:"无"}}
                        <i class="iconfont icon-jinru rightmsg"></i>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>整改责任人</label>
                        <i class="iconfont icon-required"></i>
                    </div>
                    <div class="right-select">
                        {{hiddenmeta.resolveAreaDutyPerson?hiddenmeta.resolveAreaDutyPerson:"请选择"}}
                        <i @click="newperson"
                           v-if="hiddenmeta.resolveArea=='无'"
                           class="iconfont icon-jinru rightmsg"></i>
                    </div>
                </div>
                <template v-if="hiddenmeta.resolveArea='无'">
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>整改单位</label>
                        </div>
                        <div class="right-select"
                             @click="newcompany">
                            {{hiddenmeta.ResolveDeptName?hiddenmeta.ResolveDeptName:"请选择"}}
                            <i class="iconfont icon-jinru rightmsg"></i>
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>整改执行人</label>

                        </div>
                        <div class="newcompanyList">
                            {{hiddenmeta.ResolveDutyPersonName}}
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>整改班组</label>
                        </div>
                        <div class="right-select"
                             @click="newclass">
                            {{hiddenmeta.ResolveGroup?hiddenmeta.ResolveGroup:"请选择"}}
                            <i class="iconfont icon-jinru rightmsg"></i>
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>整改班组负责人</label>
                        </div>
                        <div class="newcompanyList">
                            {{hiddenmeta.ResolveGroupDutyPerson}}
                        </div>
                    </div>
                </template>
            </div>

            <!--*************项目对项目************-->
            <div v-if="showmsg==3">

                <!-- <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>隐患部位</label>
                    </div>
                    <div class="right-select"
                        @click="newposition">
                       {{positionper.name?positionper.name:"请选择"}}<i class="iconfont icon-jinru rightmsg"></i>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>整改责任人</label>
                    </div>
                    <div class="right-select"
                        >
                       {{positionper.pName?positionper.pName:"请选择"}}<i @click="newperson" v-if="!positionper.pName" class="iconfont icon-jinru rightmsg"></i>
                    </div>
                </div>-->
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>所属单位</label>
                    </div>
                    <div class="newcompanyList"
                         style="width: 200px;height: 54px;overflow: hidden;">
                        {{hiddenmeta.deptName}}
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>被检查单位负责人</label>
                    </div>
                    <div class="newcompanyList">
                        {{hiddenmeta.projectDutyPerson}}
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>隐患部位</label>
                    </div>
                    <div class="right-select"  v-if="role==1"
                        @click="newposition">
                        <p>
                        {{hiddenmeta.resolveArea?hiddenmeta.resolveArea:"无"}}</p><i class="iconfont icon-jinru rightmsg"></i>

                    </div>
                    <div class="right-select" v-if="role!=1"
                        >
                        <p>
                        {{hiddenmeta.resolveArea?hiddenmeta.resolveArea:"无"}}</i>
                        </p>
                    </div>
                </div>
                <div class="form-item form-item-style1">
                    <div class="label-title">
                        <label>整改责任人</label>
                        <i class="iconfont icon-required"></i>
                    </div>
                    <div class="right-select" v-if="hiddenmeta.resolveArea=='无'"  @click="newperson"
                        >
                        <p>
                       {{hiddenmeta.resolveAreaDutyPerson?hiddenmeta.resolveAreaDutyPerson:"请选择"}}<i   class="iconfont icon-jinru rightmsg"></i>
                       </p>
                    </div>
                    <div class="right-select" v-if="hiddenmeta.resolveArea!='无'"
                        >
                        <p>
                       {{hiddenmeta.resolveAreaDutyPerson?hiddenmeta.resolveAreaDutyPerson:""}}
                       </p>
                    </div>
                </div>
                <div v-if="flag">
                    <div v-if="hiddenmeta.resolveArea!='无'">
                            <div class="form-item form-item-style1">
                                <div class="label-title">
                                    <label>整改单位</label>
                                </div>
                                <div class="right-select"
                                    @click="newcompany">
                                    {{hiddenmeta.ResolveDeptName?hiddenmeta.ResolveDeptName:"请选择"}}<i class="iconfont icon-jinru rightmsg"></i>
                                </div>
                            </div>
                            <div class="form-item form-item-style1">
                                <div class="label-title">
                                    <label>整改执行人</label>
                                </div>
                                <div class="newcompanyList right-select">
                                    <p>
                                    {{hiddenmeta.ResolveDutyPersonName}}
                                    </p>
                                </div>
                            </div>
                            <div class="form-item form-item-style1">
                                <div class="label-title">
                                    <label>整改班组</label>
                                </div>
                                <div class="right-select"
                                    @click="newclass">
                                    <p>
                                    {{hiddenmeta.ResolveGroup?hiddenmeta.ResolveGroup:"请选择"}}<i class="iconfont icon-jinru rightmsg"></i>
                                    </p>
                                </div>

                            </div>
                            <div class="form-item form-item-style1">
                                <div class="label-title">
                                    <label>整改班组负责人</label>
                                </div>
                                <div class="newcompanyList right-select">
                                    <p>
                                    {{hiddenmeta.ResolveGroupDutyPerson}}
                                    </p>
                                </div>
                            </div>
                    </div>
                 </div>
            </div>

            <!-- <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>被检查单位</label>
                </div>
                <div>
                    <input type="text"
                           value="某某单位">
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>被检查单位负责人</label>
                </div>
                <div>
                    <input type="text"
                           value="李周华">
                </div>
            </div>-->

            <!--<div class="form-item form-item-style1">
                <div class="label-title">
                    <label>整改单位</label>
                </div>
                <div>
                    <input type="text"
                           value="某某某单位">
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>整改执行人</label>
                </div>
                <div>
                    <input type="text"
                           value="周华健">
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>整改班组</label>
                </div>
                <div>
                    <input type="text"
                           value="某某某单位">
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>整改班组责任人</label>
                </div>
                <div>
                    <input type="text"
                           value="周华健">
                </div>
            </div>-->
        </div>
        <div class="form-section">
            <h3>检查人信息</h3>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>检查单位</label>
                </div>
                <div class="right-select">
                <p>
                   {{userInfo.deptname}}
                </p>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>检查人</label>
                </div>
                <div>
                    <input type="text"
                           :value="userInfo.username">
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>电话</label>
                </div>
                <div>
                    <input type="text"
                           :value="userInfo.tel">
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>检查时间</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <group>
                    <datetime
                    :start-date = "showDate"
                    v-model="hiddenmeta.checkTime"
                              @on-change="newchecktime"></datetime>
                </group>
            </div>
        </div>
        <!--<div class="form-section">
            <h3>整改信息</h3>
            <div class="form-item form-item-style2">
                <div class="label-title">
                    <label>整改情况回复</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div>
                    <textarea placeholder="请输入隐患描述（自行换行）"></textarea>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>实际完成时间</label>
                </div>
                <group>
                    <datetime v-model="endTime"></datetime>
                </group>
            </div>
            <div class="form-item form-item-style2">
                <div class="label-title space-between">
                    <label>整改后照片</label>
                    <span>当前共0张照片</span>
                </div>
                <div class="upload-wrap">
                    <uploader :show-header="false"
                              :autoUpload="true"
                              :uploadUrl="uploadUrl"
                              size="small"></uploader>
                </div>
            </div>-->
        <div class="btns">
            <button @click="tosavemsg">保存</button>
            <!--<button class="green">提交</button>-->
        </div>
        <myMenu></myMenu>
    </div>
</template>
<script>
import upload from '@/commonComponents/upload/index'
import myMenu from '@/commonComponents/menu'
import { XDialog, TransferDom, XHeader } from 'vux'
export default {
    directives: {
        TransferDom
    },
    data () {
        return {
            show: true,
            uploadUrl: '',
            startTime: '',
            endTime: '',
            value1: [],
            list1: [['一般隐患', '重大隐患']],
            formData: {

            },
            hiddentype: '',
            decdetail: '',
            hiddenmanage: '',
            positionArea: '',
            positionper: '',
            nextcompony: '',
            mainperson: '',
            role: '',
            HiddenDangers: [],
            uploadLength: 0, // 图片上传个数
            uploadImgFormData: null, // 图片上传formData对象
            hiddenlist: {},
            baselist: '',
            uploadImgs: [],
            images: [],
            newBlobList: [],

            category: '',
            categoryid: '',
            selectCompanny: '',
            selectperson: '',
            selectclass: '',
            selectclassperson: '',
            hiddenmeta: {
                'category': '',
                'categoryId': '',
                'checkDeptCode': '',
                'checkDeptId': '',
                'checkDeptName': '',
                'checkPerson': '',
                'checkPersonId': '',
                'checkTime': '',
                'checkWorkId': '', // 检测信息
                'deptId': '',
                'deptName': '',
                'description': '',
                'hdLevel': ['一般隐患'],
                'isApproved': false,
                'isBig': '0',
                'isChecked': false,
                'isResolved': false,
                'isSubmited': false,
                'localId': '',
                'measure': '',
                'measureEdit': false,
                'no': '',
                'problemImgs': '',
                'projectDutyPerson': '',
                'registerUserId': '',
                'resolveArea': '无',
                'resolveAreaDutyPerson': '',
                'resolveAreaDutyPersonId': '',
                'resolveEndTime': '',
                'resolveStartTime': '',
                'tel': '',
                'userId': '',
                'images': [],
                'uploadImgs': [],
                'newBlobList': [],
                'ResolveDeptName': '', // 整改单位
                'ResolveDeptCode': '',
                'ResolveDutyPersonName': '',

                'ResolveGroupId': '',
                'ResolveGroup': '',
                'ResolveGroupDutyPerson': '',
                'ResolveDeptId': ''

            },
            projectorclass: '',
            showmsg: '',
            userId: '',
            tokenId: '',
            projectId: '',
            userInfo: '',
             showDate: '',
            showDateEnd: ''
        }
    },
    created () {
        this.userInfo = JSON.parse(localStorage.userInfo)
        this.userId = this.userInfo.userid
        this.tokenId = this.userInfo.tokenId
        this.projectId = this.userInfo.deptid
        this.projectorclass = this.$store.state.checkcompany.Category // 被检查单位
        this.role = this.userInfo.departsir// 检查单位
        // this.projectorclass = 1;//项目

        // if(this.role==0){
        //     if(this.projectorclass==1||this.projectorclass==11){
        //          this.showmsg = 2;
        //     }
        // }
        // if(this.role==1)
        //     this.showmsg = 1;
        // }
        // if(this.role==11){
        //     this.showmsg = 3;
        // }
        // if(this.projectorclass==1){
            this.showmsg = 3
        // }else{
        //     this.showmsg = 1;
        // }
        console.log(this.showmsg)
        // if(this.role)
        this.$store.state.images = ''
        // console.log(this.hiddentype)
        //  this.role=3;

        //  console.log(this.$store.state.images)
        // if(localStorage.selectHideType){
        //     this.category = JSON.parse(localStorage.selectHideType).title;
        //     this.categoryid = JSON.parse(localStorage.selectHideType).id;
        // }
        // if(localStorage.baseList){
        //     this.baselist = JSON.parse(localStorage.baseList);
        // }
        // this.decdetail = localStorage.standardStr;  //描述

        // this.hiddenmanage = localStorage.hiddenmanage;
        // this.positionArea = localStorage.positionarea;
        // if(localStorage.positionper){
        //     this.positionper = JSON.parse(localStorage.positionper);
        // }
        // if(localStorage.selectcompany){
        //     this.selectCompanny = JSON.parse(localStorage.selectcompany).deptName;
        //     this.selectperson = JSON.parse(localStorage.selectcompany).DutyPerson;
        //     console.log(this.selectperson)
        // }
        // if(localStorage.newclass){
        //     this.selectclass = JSON.parse(localStorage.newclass).deptName;
        //     this.selectclassperson = JSON.parse(localStorage.newclass).DutyPerson;
        //     console.log(this.selectperson)
        // }
        //   this.nextcompony = localStorage.nextcompony;
        //   this.mainperson = localStorage.mainperson;

        // debugger;

        if (this.$store.state.hiddenlist) {
            //  this.$store.state.hiddenlist =Object.assign({},this.$store.state.hiddenlist,{
            //         "deptName": hiddenmeta.Name,
            //          "deptId":this.$store.state.checkcompany.Id,
            //          "projectDutyPerson":this.$store.state.checkcompany.DutyPerson
            // })

            this.hiddenmeta = Object.assign({}, this.hiddenmeta, this.$store.state.hiddenlist)
            if (this.hiddenmeta.images) {
                this.images = this.hiddenmeta.images
                this.uploadImgs = this.hiddenmeta.uploadImgs
                // this.startTime = this.hiddenmeta.startTime;
            }
        } else {
            this.hiddenmeta.Name = this.$store.state.checkcompany.Name
        }
        if (!this.hiddenmeta.resolveStartTime) {
            this.hiddenmeta.resolveStartTime = this.getdatenew()
        }
        if (!this.hiddenmeta.checkTime) {
             this.hiddenmeta.checkTime = this.getdatenew()
        }
        this.showDate = this.getdatenew()
        this.showDateEnd = this.hiddenmeta.resolveStartTime
    },
    components: {
        upload,
        XDialog,
        XHeader,
        myMenu
    },
    methods: {
        toselectmsg () {
            if (!this.$store.state.hiddenlist.categoryId) {
                this.$vux.toast.text('请选择隐患类别')
                return false
            }
            this.$router.push('/selectStandard')
        },
        selectType () {
            this.$router.push({ path: '/searchnew' })
        },
        newposition () {
            this.$router.push({ path: '/yhposition' })
        },
        newperson () {
            this.$router.push({ path: '/yhperson' })
        },
        newcompany () {
            this.$router.push({ path: '/yhcompany' })
        },
        newclass () {
            if (!this.$store.state.hiddenlist.ResolveDeptId) {
                this.$vux.toast.text('请选择整改单位')
                return false
            }
            this.$router.push({ path: '/yhclass' })
        },
        hiddleType () { // 获取隐患类别
            let param = {
                'allowPaging': true,
                'business': 'FetchHiddenDangerStandards',
                'data': {
                    'ProjectId': this.projectId
                },
                'pageIndex': 0,
                'pageSize': 20,
                'tokenId': this.tokenId,
                'userId': this.userId
            }
            this.$axiosAjax.getConfigJson(
                param
            ).then(
                (res) => {
                    this.theModel = res.data.data
                }
            )
        },
        hiddledesc () { // 获取隐患类别
            let param = {
                'allowPaging': true,
                'business': 'FetchHiddenDangerStandards',
                'data': {
                    'ProjectId': '930732390',
                    'id': '192cd6e0-1ed3-4808-805b-32451d097032'
                },
                'pageIndex': 0,
                'pageSize': 20,
                'tokenId': 'A3944C2D655B11D684296E71CB81C9BD',
                'userId': '615123137'
            }
            this.$axiosAjax.getConfigJson(
                param
            ).then(
                (res) => {
                    this.theModel = res.data.data
                }
            )
        },
        hiddlechange () {
            let param = {
                'allowPaging': true,
                'business': 'GetFetchHiddenDangerStandardDetail',
                'data': '0df5ea1e-9886-4af2-9c2d-63c8fa08c772,1544b816-54f9-4c29-9d53-6d63f488d3d6',
                'pageIndex': 0,
                'pageSize': 0,
                'tokenId': this.tokenId,
                'userId': this.userId
            }
            this.$axiosAjax.getConfigJson(
                param
            ).then(
                (res) => {
                    this.theModel = res.data.data
                }
            )
        },
        showimage (file) {
        },
        addimage (formdata) {

        },
        previewmsg (image) {

        },
        tosavemsg () {
            let a = new Date()
            let arr = []
             this.newBlobList.forEach(
                (item) => {
                    arr = [...arr, item.name]
                }
            )
            let parrams = {
                'category': this.hiddenmeta.category, // 1
                'categoryId': this.hiddenmeta.categoryId, // 1
                'checkDeptCode': this.userInfo.deptcode, // d
                'checkDeptId': this.userInfo.deptid, // d
                'checkDeptName': this.userInfo.deptname, // d
                'checkPerson': this.userInfo.username, // d
                'checkPersonId': this.userInfo.userid, // d
                'checkTime': this.hiddenmeta.checkTime, // 1
                'checkWorkId': '', // 检测信息
                'deptId': this.hiddenmeta.deptId, // 所属项目ID
                'deptName': this.hiddenmeta.deptName, // 所属项目名称
                'description': this.hiddenmeta.description, // 隐患描述
                'hdLevel': this.hiddenmeta.hdLevel,
                'isApproved': false,
                'isBig': this.hiddenmeta.hdLevel[0] == '一般隐患' ? 0 : 1,
                'isChecked': false,
                'isResolved': false,
                'isSubmited': false,
                'localId': this.hiddenmeta.localId ? this.hiddenmeta.localId : a.getTime(),
                'measure': this.hiddenmeta.measure,
                'measureEdit': false, //
                'no': '',
                'problemImgs': arr,
                'projectDutyPerson': this.hiddenmeta.projectDutyPerson, // 项目负责人姓名||
                'registerUserId': this.userInfo.userid, // 登陆拿
                'resolveArea': this.hiddenmeta.resolveArea,
                'resolveAreaDutyPerson': this.hiddenmeta.resolveAreaDutyPerson,
                'resolveAreaDutyPersonId': this.hiddenmeta.resolveAreaDutyPersonId,
                'resolveEndTime': this.hiddenmeta.resolveEndTime,
                'resolveStartTime': this.hiddenmeta.resolveStartTime,
                'tel': this.userInfo.tel,
                'userId': this.userInfo.userid,
                'images': this.images,
                'uploadImgs': this.uploadImgs,
                'formData': this.uploadImgFormData,
                'newBlobList': this.newBlobList,

                'ResolveDeptName': this.hiddenmeta.ResolveDeptName, // 整改单位
                'ResolveDeptCode': this.hiddenmeta.ResolveDeptCode,
                'ResolveDutyPersonName': this.hiddenmeta.ResolveDutyPersonName,
                'ResolveDeptId': this.hiddenmeta.ResolveDeptId,
                'ResolveGroupId': this.hiddenmeta.ResolveGroupId,
                'ResolveGroup': this.hiddenmeta.ResolveGroup,
                'ResolveGroupDutyPerson': this.hiddenmeta.ResolveGroupDutyPerson
                // "ResolveAreaDutyPersonId":this.hiddenmeta.ResolveAreaDutyPersonId,

            }
            parrams.state = this.typechange(parrams) ? '已填写' : '未填写'
            if (this.$route.query.localId) {
                // debugger;
                let localId = this.$route.query.localId
                // this.$store.state.HiddenDangers = this.HiddenDangers;
                this.$store.state.HiddenDangers.forEach(
                    (item, index) => {
                        if (item.localId == localId) {
                            this.$store.state.HiddenDangers[index] = parrams
                        }
                    }
                )
                // console.log();
                // this.$store.state.HiddenDangers[index-1]['value'][indexlist-1] = parrams;
            } else {
                if (this.$store.state.HiddenDangers.length == 0) {
                    this.$store.state.HiddenDangers = [parrams]
                } else {
                    this.$store.state.HiddenDangers = [...this.$store.state.HiddenDangers, parrams]
                }
            }
            // localStorage.uploadImgFormData = JSON.stringify(this.uploadImgFormData);
            // localStorage.uploadImgs = JSON.stringify(this.images);

            // localStorage.HiddenDangers = JSON.stringify(this.HiddenDangers);
            this.$router.push({ path: '/view3Details' })
        },
        setFormData (formData, uploadLength, uploadImgs, images, newBlobList) {
            this.uploadImgFormData = formData
            this.uploadLength = uploadLength
            this.uploadImgs = uploadImgs
            this.images = images
            this.newBlobList = newBlobList
            this.$store.state.images = this.images
            this.$store.state.uploadImgs = this.uploadImgs
            this.$store.state.formData = Object.assign({}, this.uploadImgFormData)
            this.$store.state.hiddenlist = Object.assign({}, this.$store.state.hiddenlist, {
                'images': this.images,
                'uploadImgs': this.$store.state.uploadImgs,
                'newBlobList': newBlobList
            })
        },
        typechange (item) {
            if (!item.category) {
                return false
            }
            if (!item.checkDeptName) {
                return false
            }
            if (!item.description) {
                return false
            }
            if (!item.deptName) {
                return false
            }
            if (!item.measure) {
                return false
            }
            if (!item.resolveStartTime) {
                return false
            }
            if (!item.resolveEndTime) {
                return false
            }
            if (!item.resolveAreaDutyPerson) {
                return false
            }
            if (!item.checkTime) {
                return false
            }
            return true
        },
        newchange (val) {
            this.$store.state.hiddenlist = Object.assign({}, this.$store.state.hiddenlist, {
                'resolveStartTime': val
            })
            this.$store.state.startTime = this.startTime
            this.showDateEnd = val
              this.hiddenmeta.resolveEndTime = ''
        },
        newchangeend (val) {
            this.$store.state.hiddenlist = Object.assign({}, this.$store.state.hiddenlist, {
                'resolveEndTime': val
            })
            this.$store.state.startEnd = this.startEnd
        },
        newchecktime (val) {
            this.$store.state.hiddenlist = Object.assign({}, this.$store.state.hiddenlist, {
                'checkTime': val
            })
        },
        changeleve (val) {
            //  debugger;
            this.hiddenmeta.hdLevel = val
            this.$store.state.hiddenlist = Object.assign({}, this.$store.state.hiddenlist, {
                'hdLevel': val
            })
        },
        hidenewfirst (val) {
            // debugger;
            this.$store.state.hiddenlist = Object.assign({}, this.$store.state.hiddenlist, {
                'description': val
            })
        },
        hidenewtwo (val) {
            this.$store.state.hiddenlist = Object.assign({}, this.$store.state.hiddenlist, {
                'measure': val
            })
        },
        getdatenew () {
            var date = new Date()
            var seperator1 = '-'
            var year = date.getFullYear()
            var month = date.getMonth() + 1
            var strDate = date.getDate()
            if (month >= 1 && month <= 9) {
                month = '0' + month
            }
            if (strDate >= 0 && strDate <= 9) {
                strDate = '0' + strDate
            }
            var currentdate = year + seperator1 + month + seperator1 + strDate
            return currentdate
         }
    },
    activated () {
        // debugger;
        // console.log(this.$store.state.images)
        // if(localStorage.selectHideType){
        //     this.category = JSON.parse(localStorage.selectHideType).title;
        //     this.categoryid = JSON.parse(localStorage.selectHideType).id;
        // }
        // if(localStorage.baseList){
        //     this.baselist = JSON.parse(localStorage.baseList);
        // }
        // this.decdetail = localStorage.standardStr;  //描述

        // this.hiddenmanage = localStorage.hiddenmanage;
        // this.positionArea = localStorage.positionarea;
        // if(localStorage.positionper){
        //     this.positionper = JSON.parse(localStorage.positionper);
        // }
        //  this.nextcompony = localStorage.nextcompony;
        //   this.mainperson = localStorage.mainperson;
        //   this.$forceUpdate()
    }
}
</script>
<style lang="less" scoped>
.right-select {
    display: flex;
    justify-content: flex-end;
    font-size: 13px;
    color: #999;
    height: 20px;
    width: 180px;
    position: relative;
    // padding-right: 20px;
    line-height: 20px;
}
.right-select p {
    width: 130px;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.right-select > i::before {
    color: #c8c8cd;
}
.btns .green {
    background: #15bc84;
}
.newcompanyList {
    font-size: 14px;
    text-align: right;;
    color:#999
}

</style>
